package com.checkoutcheckins.client.handlers;

import com.checkoutcheckins.client.data.foursquare.Checkin;
import com.checkoutcheckins.client.panels.VenuePanel;
import com.google.gwt.maps.client.InfoWindow;
import com.google.gwt.maps.client.InfoWindowContent;
import com.google.gwt.maps.client.MapWidget;
import com.google.gwt.maps.client.event.MarkerClickHandler;
import com.google.gwt.maps.client.overlay.Marker;

public class CheckinMarkerClickHandler implements MarkerClickHandler {

	private MapWidget map;
	private Checkin checkin;
	private Marker marker;

	public CheckinMarkerClickHandler(Marker marker, MapWidget map, Checkin checkin) {
		this.map = map;
		this.checkin = checkin;
		this.marker = marker;
	}

	@Override
	public void onClick(MarkerClickEvent event) {
		InfoWindow info = map.getInfoWindow();
		info.open(marker,
				new InfoWindowContent(new VenuePanel(checkin)));
	}

}
